package cn.xingchen.xiangqin.service.impl;

import java.util.List;

import cn.xingchen.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xingchen.xiangqin.mapper.OnWallMapper;
import cn.xingchen.xiangqin.domain.OnWall;
import cn.xingchen.xiangqin.service.IOnWallService;

/**
 * 上墙Service业务层处理
 * 
 * @author 爱喝茶的耀哥
 * @date 2023-05-20
 */
@Service
public class OnWallServiceImpl implements IOnWallService 
{
    @Autowired
    private OnWallMapper onWallMapper;

    /**
     * 查询上墙
     * 
     * @param id 上墙主键
     * @return 上墙
     */
    @Override
    public OnWall selectOnWallById(Long id)
    {
        return onWallMapper.selectOnWallById(id);
    }

    /**
     * 查询上墙列表
     * 
     * @param onWall 上墙
     * @return 上墙
     */
    @Override
    public List<OnWall> selectOnWallList(OnWall onWall)
    {
        return onWallMapper.selectOnWallList(onWall);
    }

    /**
     * 新增上墙
     * 
     * @param onWall 上墙
     * @return 结果
     */
    @Override
    public int insertOnWall(OnWall onWall)
    {
        onWall.setCreateTime(DateUtils.getNowDate());
        return onWallMapper.insertOnWall(onWall);
    }

    /**
     * 修改上墙
     * 
     * @param onWall 上墙
     * @return 结果
     */
    @Override
    public int updateOnWall(OnWall onWall)
    {
        onWall.setUpdateTime(DateUtils.getNowDate());
        return onWallMapper.updateOnWall(onWall);
    }

    /**
     * 批量删除上墙
     * 
     * @param ids 需要删除的上墙主键
     * @return 结果
     */
    @Override
    public int deleteOnWallByIds(Long[] ids)
    {
        return onWallMapper.deleteOnWallByIds(ids);
    }

    /**
     * 删除上墙信息
     * 
     * @param id 上墙主键
     * @return 结果
     */
    @Override
    public int deleteOnWallById(Long id)
    {
        return onWallMapper.deleteOnWallById(id);
    }
}
